import java.io.*;

public class Main {
    public static void main(String[] args) throws IOException {
        try {BufferedReader br = new BufferedReader(new FileReader("D:\\Java\\IO\\text\\aaa.txt"));
                BufferedWriter bw = new BufferedWriter(new FileWriter("D:\\Java\\IO\\text\\bbb.txt"));
                String s = "";
                int i = 1;
                while ((s = br.readLine())!=null){
                    bw.write(""+i);
                    i++;
                    bw.write(s);
                    bw.newLine();
                }
                br.close();
                bw.close();
    }catch (IOException e){
            e.printStackTrace();
        }
    }
}
